package com.euro.video.phone.entities;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Entity
@Table(name = "devis", schema = "evp_db")
@NamedQueries({
	@NamedQuery(name="devisNonTraites", query="select dev from Devis dev where dev.traite=false"),
	@NamedQuery(name="devisTraites", query="select dev from Devis dev where dev.traite=true"),
	@NamedQuery(name="devisParEmail", query="select dev from Devis dev where dev.email = :email"),
	@NamedQuery(name="devisParTelephone", query="select dev from Devis dev where dev.telephone = :telephone")
})
public class Devis implements Serializable {
	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(insertable = false, updatable = false)
	private long id;
	@Column(updatable = false, insertable = true, nullable = false, columnDefinition="longtext")
	private String message;
	@Column(updatable = false, insertable = true, nullable = true)
	private String email;
	@Column(updatable = false, insertable = true, nullable = true)
	private String telephone;
	@Column(updatable=true, insertable=true, nullable=false)
	private boolean traite;
	@Column(updatable=false, insertable=true, nullable=false)
	private Date creation;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	public boolean isTraite() {
		return traite;
	}

	public void setTraite(boolean traite) {
		this.traite = traite;
	}

	public Date getCreation() {
		return creation;
	}

	public void setCreation(Date creation) {
		this.creation = creation;
	}
}
